﻿using SD.Infrastructure.RepositoryBase;
using SlamDunk.MES.Domain.Entities.PlanContxt;
using SlamDunk.ValueObjects.Enums;
using System;
using System.Collections.Generic;

namespace SlamDunk.MES.Domain.IRepositories.Interfaces.PlanContxt
{
    /// <summary>
    /// 作业计划仓储接口
    /// </summary>
    public interface IExecutionPlanRepository : IAggRootRepository<ExecutionPlan>
    {
        #region # 分页获取作业计划列表 —— ICollection<ExecutionPlan> FindByPage(string keywords...
        /// <summary>
        /// 分页获取作业计划列表
        /// </summary>
        /// <param name="keywords">关键字</param>
        /// <param name="productId">产品Id</param>
        /// <param name="processId">工艺Id</param>
        /// <param name="bomId">物料清单Id</param>
        /// <param name="productionPlanId">生产计划Id</param>
        /// <param name="status">作业计划状态</param>
        /// <param name="checkStatus">审核状态</param>
        /// <param name="hasGeneratedWorkOrders">是否已生成工单</param>
        /// <param name="hasInspected">是否已质检</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <param name="facilityIds">工厂模型Id集</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">页容量</param>
        /// <param name="rowCount">总记录数</param>
        /// <param name="pageCount">总页数</param>
        /// <returns>作业计划列表</returns>
        ICollection<ExecutionPlan> FindByPage(string keywords, Guid? productId, Guid? processId, Guid? bomId, Guid? productionPlanId, ExecutionPlanStatus? status, CheckStatus? checkStatus, bool? hasGeneratedWorkOrders, bool? hasInspected, DateTime? startTime, DateTime? endTime, IList<Guid> facilityIds, int pageIndex, int pageSize, out int rowCount, out int pageCount);
        #endregion

        #region # 获取作业计划状态/数量字典 —— IDictionary<ExecutionPlanStatus, int> GetExecutionPlanStatusCounts(...
        /// <summary>
        /// 获取作业计划状态/数量字典
        /// </summary>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns>作业计划状态/数量字典</returns>
        IDictionary<ExecutionPlanStatus, int> GetExecutionPlanStatusCounts(DateTime startTime, DateTime endTime);
        #endregion
    }
}
